<?php
$viewdefs ['Tasks'] = array (
  'EditView' => array (
    'templateMeta' => array (
'javascript' => '<script type="text/javascript" src="custom/modules/Tasks/taskselection.js" ></script> ',
      'form' => array (
        'hidden' => array (
          '<input type="hidden" name="isSaveAndNew" value="false">',
        ),
        'buttons' => array (
			0=>'SAVE',
			1 =>
				array(
		         	'customCode' =>'<input type="hidden" name="button click" value="assign_complete"><input title="{$MOD.LBL_ASSIGNMENT_COMPLETE_TITLE}" class="button"  onclick="this.form.return_module.value=\'Tasks\'; disableOnUnloadEditView(this.form); this.form.return_id.value=\'{$fields.id.value}\';this.form.action.value=\'AssignCompleted\'"  name="assigin_completed"  value="{$MOD.LBL_ASSIGNMENT_COMPLETE_TITLE}"  type="submit">',
				),
			2 =>
				array(
		         	'customCode' =>'<input type="hidden" name="button click" value="decline_complete"><input title="{$MOD.LBL_ASSIGNMENT_FAST_FAIL_TITLE}" class="button"  onclick="this.form.return_module.value=\'Tasks\'; disableOnUnloadEditView(this.form); this.form.return_id.value=\'{$fields.id.value}\';this.form.action.value=\'DeclineCompleted\'"  name="button1"  value="{$MOD.LBL_ASSIGNMENT_FAST_FAIL_TITLE}"  type="submit">',
				),
			3 =>
				array(
		         	'customCode' =>'<input type="hidden" name="button click" value="fastfail_complete"><input title="{$MOD.LBL_FAST_FAIL_COMPLETE_TITLE}" class="button"  onclick="this.form.return_module.value=\'Tasks\'; disableOnUnloadEditView(this.form); this.form.return_id.value=\'{$fields.id.value}\';this.form.action.value=\'FastFailCompleted\'"  name="button1"  value="{$MOD.LBL_FAST_FAIL_COMPLETE_TITLE}"  type="submit">',
				),    
			4=>'CANCEL', 
        ),
      ),
      'maxColumns' => '2',
      'widths' =>  array (
        array (
          'label' => '10',
          'field' => '30',
        ),
        array (
          'label' => '10',
          'field' => '30',
        ),
      ),
      'useTabs' => false,
    ),
'panels' => array (
	'lbl_task_information' => array (
		array (
			array (
	            'name' => 'name',
	            'displayParams' =>array (
	              			'required' => true,
	           		 		),
			),
			array (
	            'name' => 'status',
	            'displayParams' =>array (
							'required' => true,
							),
			),
		),
		array (
			array (
	            'name' => 'break_duration_hours',
	            'label' => 'LBL_BREAK_DURATION',
	            'customCode' => '{literal}<script type="text/javascript">function isValidDuration() { form = document.getElementById(\'EditView\'); if ( form.break_duration_hours.value + form.break_duration_minutes.value <= 0 ) { alert(\'{/literal}{$MOD.NOTICE_DURATION_TIME}{literal}\'); return false; } return true; }</script>{/literal}<input name="break_duration_hours" tabindex="1" size="2" maxlength="2" type="text" value="{$fields.break_duration_hours.value}" onkeyup="SugarWidgetScheduler.update_time();"/>{$fields.break_duration_minutes.value}&nbsp;<span class="dateFormat">{$MOD.LBL_HOURS_MINUTES}</span>',

			),
			array (
	            'name' => 'date_start',
	            'type' => 'datetimecombowithminutes',
	            'displayParams' =>  array (
	              'showNoneCheckbox' => true,
	              'showFormats' => true,
	            ),
          ),
		),
        array (
			array (
	            'name' => 'date_due',
	            'type' => 'datetimecombo',
	            'displayParams' => array (
	              'showNoneCheckbox' => true,
	              'showFormats' => true,
	            ),
			),
			array (
	            'name' => 'completed_date',
	            'type' => 'datetimecombowithminutes',
	            'displayParams' => array (
	              'showNoneCheckbox' => true,
	              'showFormats' => true,
	            ),
			),
		),
        array (
			'description',
			'type'=>array
                                   (
					'name'=>'type',
			            'displayParams' => 
			            array (
			              'javascript' => 'onchange="changetype(this.value);"',
			            ),
                                   ),
        ),
	),
	'LBL_PANEL_ASSIGNMENT' => array (
		array (
				array('name'=>'assigned_user_name',),
				array('name'=>'related_editor_full_name',
						'displayParams' => array('field' => array('onblur' => 'changeRelatedExpert(this.value)'),),
						),
		),
	),
	'LBL_PANEL_ASSIGN_AN_EXPERT'=> array(
      	array(
      		array('name'=>'assigned_user_name',),
      		array (
            'name' => 'date_due',
            'type' => 'datetimecombo',
            'displayParams' => array (
					              'showNoneCheckbox' => true,
					              'showFormats' => true,
							),
			),
		),
		array(
			array('name'=>'description',
				  'label'=>'LBL_PERSONAL_MESSAGE_TO_EXPERT',
			),
		),     	   
	),
	'LBL_DECLINING_INFORMATION'=> array(
		array(
			array('name'=>'description',
				  'label'=>'LBL_REASON_FOR_DECLINE',
			),
		),
	),
	'LBL_PANEL_FAST_FAIL_TASKFAST'=>array(
		array(
			array(
				'name'=>'assigned_user_name',
				'type'=>'readonly'	
			),
		),		
		array(
			array (
            'name' => 'date_due',
            'type' => 'datetimecombo',
            'displayParams' => array (
					              'showNoneCheckbox' => true,
					              'showFormats' => true,
							),
			),
		),
		array(
			array('name'=>'description',),						
		),
	),
	),
  ),
);
?>
